<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
    <title>11.11这些东西你都抢到了吗？</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
	<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div id="wrapper">
		<div class="page page0">
			<img src="images/logo.png" class="logo">
			<div class="page0-con">
				<span class="page0-con-l"></span><span class="page0-con-r"><img src="images/page0.png" class="page0-pic"><a href="javascript:;" class="startgame"></a></span>
			</div>
		</div>
		<div class="page page1" style="display: none;">
			<p class="clicktips">点击图片可以选择物品的数量哦～</p>
			<span class="goods-box">
				<img src="images/pic.png" class="page1-pic">
				<a href="javascript:;" title="电视机" class="a1" data-counts='0'></a><div class="num num1"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="空调" class="a2" data-counts='0'></a><div class="num num2"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="马车" class="a3" data-counts='0'></a><div class="num num3"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="笔记本" class="a4" data-counts='0'></a><div class="num num4"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="彩电" class="a5" data-counts='0'></a><div class="num num5"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="姨妈巾" class="a6" data-counts='0'></a><div class="num num6"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="手纸" class="a7" data-counts='0'></a><div class="num num7"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="椅子" class="a8" data-counts='0'></a><div class="num num8"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="婴儿车" class="a9" data-counts='0'></a><div class="num num9"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="厨房电器" class="a10" data-counts='0'></a><div class="num num10"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="洗衣机" class="a11" data-counts='0'></a><div class="num num11"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="冰箱" class="a12" data-counts='0'></a><div class="num num12"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="护肤品" class="a13" data-counts='0'></a><div class="num num13"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="四件套" class="a14" data-counts='0'></a><div class="num num14"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="包包" class="a15" data-counts='0'></a><div class="num num15"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="零食" class="a16" data-counts='0'></a><div class="num num16"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="婴儿衣服" class="a17" data-counts='0'></a><div class="num num17"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="成人衣服" class="a18" data-counts='0'></a><div class="num num18"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="照相机" class="a19" data-counts='0'></a><div class="num num19"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="鞋子" class="a20" data-counts='0'></a><div class="num num20"><em>0</em><span>+1</span></div>
				<a href="javascript:;" title="洗护用品" class="a21" data-counts='0'></a><div class="num num21"><em>0</em><span>+1</span></div>
			</span>
			<a href="javascript:;" class="btn page1-next">选好啦，下一步</a>
			<div class="car"><img src="images/car.png"><em class="total" data-total='0'>0</em></div>
			<div class="pop">
				<div class="pop-con">
					<img src="images/pop_bg.png"/>
					<form onsubmit="return false">
						<input type="text" class="text" placeholder="请输入小区名字" />
						<p>注：输入居住的小区名更好的计算价格哦～</p>
						<input type="submit" value="下一步" class="btn">
					</form>
				</div>
			</div>
		</div>
		<div class="page page2" style="display: none;">
			<p class="p1">别以为双十一贪了便宜</br>额外消费绝对让你想不到！</p>
			<p class="p2">（分享后结果会自动弹出哦～）</p>
			<a href="javascript:;" class="share-btn"><img src="images/share.png"></a>
		</div>
		<div class="page page3" style="display: none;">
			<img src="images/bg.png" class="page3-bg">
			<div class="page3-con">
				<img src="images/page3-pic.png" class="page3-pic" />
				<p class="page3-p1">居然多花了¥50000！</p>
				<p class="page3-p2">你买的物品已占据XXX平米</p>
				<p class="page3-p3">都可以在黄埔<br/>买个厕所啦！</p>
				<div class="page3-bottom">
					<span class="page3-p4"><img src="images/page3-pic1.png" class="page3-pic1">在66<br/>24小时转出二手闲置<br/>让钱真正省出来<img src="images/page3-pic2.png" class="page3-pic2"></span>
					<p class="page3-p5">赶快去发闲置吧！</p>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
<script src="http://libs.baidu.com/jquery/1.7.0/jquery.min.js"></script>
<script>
	$(function(){
		//封面图  浏览器适配
		if($('.page0-con').width()/$('.page0-con').height()>600/824){
			$('.page0-pic').height($('.page0-con').height());
		}
	});
	$(window).load(function(){
		//开始游戏
		$('.startgame').click(function(){
			$('.page0').hide();
			$('.page1').show();
			//第二屏幕  浏览器适配
			if($('.page1-pic').height()<$('.goods-box').height()){
				$('.goods-box').css('margin-top',($('.goods-box').height()-$('.page1-pic').height())/2);
				$('.goods-box').height($('.page1-pic').height());
			}
		});
		/*点击数字叠加*/
		$('.goods-box a').each(function(i){
			$(this).on('touchstart',function(){
				var _counts=$(this).data('counts');
				var _em=$('.num').eq(i).find('em');
				$(this).data('counts',_counts+1);
				$('.num').eq(i).show().addClass('addOne');
				if(_counts>=99){
					_em.html('...');
				}else{
					_em.html(_counts+1);
				}
				setTimeout(function(){
					$('.num').removeClass('addOne');
				},300);
				//总数
				var total=$('.total').data('total');
				$('.total').data('total',total+1);
				if(total>=99){
					$('.total').html('...');
				}else{
					$('.total').html(total+1);
				}
			});
		});
		//显示表单
		$('.page1-next').click(function(){
			$('.pop').show();
		})
		//隐藏表单
		$('.pop').click(function(e){
			$(this).hide();
		});
		$('.pop-con').click(function(e){
			return false;
		});
		//显示分享页
		$('.pop .btn').click(function(){
			$('.page1').hide();
			$('.page2').show();
		});
		//显示分享结果页
		$('.share-btn').click(function(){
			$('.page2').hide();
			$('.page3').show();
		});
	});
	//表单弹出时兼容
	var height=$(window).height();
	$(window).resize(function(){
		if($(window).height()<height){
			$('body').height(height);
		}
	});
</script>